package com.taiyuan.zfmvp.controller;

import java.util.LinkedList;

/**
 * @param request
 * @Author: zhoufang@si-tech.com.cn
 * @Descriiption:
 * @Date 2022/7/18
 * @return
 */
public class MyQueue {

    private LinkedList list = new LinkedList();

    public void put(Object t){ //加入数据
        list.addFirst(t);
    }
    public Object get(){ //取出先加入的数据
        return  list.removeLast();
    }
    public boolean isEmpt(){
        return  list.isEmpty();
    }

    public int getSize(){
        return  list.size();
    }

    public Object getIndex(int i){
        return  list.get(i);
    }
    public String getLinkStr(){
        String str = "";
        for (int i = list.size(); i > 0 ; i--) {
            if(i==1){
                str+=list.get(i-1);
            }else{
                str+=list.get(i-1)+",";
            }

        }
        return str;
    }

}
